import React, { Component } from 'react'
import PropTypes from 'prop-types';

export class Tabtitle extends Component {
    render() {
        const {list}=this.props
        return (
            <div>
                {list.length ? list.map((item,index)=>{
                    return <button key={item.id}>
                        <b>{item.title}</b>
                        <span>✖</span>
                    </button>
                }):'暂无数据'}
            </div>
        )
    }
}

Tabtitle.propTypes = {
    list: PropTypes.array
};

Tabtitle.defaultProps = {
    list: []
  };

export default Tabtitle